package main

import (
	"encoding/json"
	"fmt"
)

type A struct {
	Name string
}

func main() {
	a := A{Name: "12312312"}
	b, _ := json.Marshal(a)
	aa := A{}
	unmarshal(b, &aa)
	fmt.Println(aa)
}

func unmarshal(data []byte, s interface{}) {
	json.Unmarshal(data, s)
}
